#include <iostream>
#include <vector>
#include <stdio.h>
using namespace std;

static long long CalcLen(long long num) {
    long long res = 1;
    for (; num != 1; ++res) {
        if (num % 2 == 0)
            num >>= 1;
        else
            num = 3 * num + 1;
    }
    return res;
}

int main() {
    /*int i, j;
    while (scanf("%d %d", &i, &j) != EOF) {
        int max = 0;
        for (int k = i; k <= j; ++k) {
            const int cur_len = CalcLen(k);
            if (cur_len > max)
                max = cur_len;
        }
        printf("%d %d %d\n", i, j, max);
    }*/

    vector<int> input1;
    vector<int> input2;
    int a, b;
    while (scanf("%d %d", &a, &b) != EOF) {
        input1.push_back(a);
        input2.push_back(b);
    }

    const size_t input_size = input1.size();
    for (size_t i = 0; i < input_size; ++i) {
        const int a = input1[i],
                  b = input2[i];
        long long max = 0;
        for (int k = a; k <= b; ++k) {
            const long long cur_len = CalcLen(k);
            if (cur_len > max)
                max = cur_len;
        }
        printf("%d %d %lld", a, b, max);
        //if (i != (input_size - 1))
            printf("\n");
    }

    return 0;
}
